<?php
class Links_Model extends General_Model {

	function getlinks() {
		$query = $this->db->get ( 'links' );
		$query=$this->db->query("SELECT ci_links.*,ci_gallery.file_name FROM `ci_links`
							LEFT JOIN ci_gallery ON ci_gallery.id=ci_links.img_id");
		$list = $query->result_array();
		return $list;
	}

	function lay_dulieu_link_sua($id) {
	    $this->db->where ( 'id', $id );
		$query = $this->db->get ( 'links' );
		$dulieu = $query->result_array();
		return $dulieu;
	}

	function del($id) {
		$this->db->where ( 'id', $id );
		$this->db->limit ( 1, 0 );
		$this->db->delete ( 'links' );
		return TRUE;
	}
}